home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 97 / maccd 97.iso / utilities / Mac OS X / PCI Extreme! / PCI Extreme Source / PCI Extreme.applescript < prev    next >
Encoding:
Text File  |  2002-08-30  |  6.5 KB  |  171 lines

  1. -- PCI Extreme.applescript
  2. -- PCI Extreme
  3.  
  4. --  Created by Zack Schilling on Thu Aug 29 2002.
  5. --  Copyright (c) 2002 Zack Schilling Software. All rights reserved.
  6.  
  7. on choose menu item theObject
  8.  
  9.     if name of theObject is "sysDefault"
  10.     tell window "main"
  11.         set contents of text field "minVRAM" to 16
  12.                 set state of button "onAGP" to true
  13.                 set state of button "onPCI" to false
  14.                 set state of button "onPortable" to true
  15.         set contents of text field "tileHeight" to 256
  16.         set contents of text field "tileWidth" to 256
  17.         set contents of text field "minDepth" to 16
  18.     end tell
  19.     end if
  20.     
  21.     if name of theObject is "pciAGP"
  22.     tell window "main"
  23.         set contents of text field "minVRAM" to 16
  24.                 set state of button "onAGP" to true
  25.                 set state of button "onPCI" to true
  26.                 set state of button "onPortable" to true
  27.         set contents of text field "tileHeight" to 256
  28.         set contents of text field "tileWidth" to 256
  29.         set contents of text field "minDepth" to 16
  30.     end tell
  31.     end if
  32.     
  33.   if name of theObject is "oldPortables"
  34.     tell window "main"
  35.         set contents of text field "minVRAM" to 8
  36.                 set state of button "onAGP" to true
  37.                 set state of button "onPCI" to false
  38.                 set state of button "onPortable" to true
  39.         set contents of text field "tileHeight" to 256
  40.         set contents of text field "tileWidth" to 256
  41.         set contents of text field "minDepth" to 16
  42.     end tell
  43.     end if
  44.     
  45.         if name of theObject is "off"
  46.     tell window "main"
  47.         set contents of text field "minVRAM" to 16
  48.                 set state of button "onAGP" to false
  49.                 set state of button "onPCI" to false
  50.                 set state of button "onPortable" to false
  51.         set contents of text field "tileHeight" to 256
  52.         set contents of text field "tileWidth" to 256
  53.         set contents of text field "minDepth" to 16
  54.     end tell
  55.     end if
  56.     
  57.         if name of theObject is "pciOnly"
  58.     tell window "main"
  59.         set contents of text field "minVRAM" to 16
  60.                 set state of button "onAGP" to false
  61.                 set state of button "onPCI" to true
  62.                 set state of button "onPortable" to false
  63.         set contents of text field "tileHeight" to 256
  64.         set contents of text field "tileWidth" to 256
  65.         set contents of text field "minDepth" to 16
  66.     end tell
  67.     end if
  68.     
  69.         if name of theObject is "agpOnly"
  70.     tell window "main"
  71.         set contents of text field "minVRAM" to 16
  72.                 set state of button "onAGP" to true
  73.                 set state of button "onPCI" to false
  74.                 set state of button "onPortable" to false
  75.         set contents of text field "tileHeight" to 256
  76.         set contents of text field "tileWidth" to 256
  77.         set contents of text field "minDepth" to 16
  78.     end tell
  79.     end if
  80.     
  81.         if name of theObject is "portableOnly"
  82.     tell window "main"
  83.         set contents of text field "minVRAM" to 16
  84.                 set state of button "onAGP" to false
  85.                 set state of button "onPCI" to false
  86.                 set state of button "onPortable" to true
  87.         set contents of text field "tileHeight" to 256
  88.         set contents of text field "tileWidth" to 256
  89.         set contents of text field "minDepth" to 16
  90.     end tell
  91.     end if
  92.     
  93.     if name of theObject is "lowColor"
  94.     tell window "main"
  95.         set contents of text field "minDepth" to 8
  96.     end tell
  97.     end if
  98.     
  99. end choose
  100.  
  101. on clicked theObject 
  102. if name of theObject is "applyAndRestart"
  103.  
  104. set temp to display dialog "Are you sure you want to apply these changes and restart?" buttons ("Cancel", "Yes") default button 2
  105. if button returned of temp = "Yes"
  106.  
  107. do shell script "cp -f /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/Configuration.plist $home/Library/Preferences/"
  108.  
  109. if (state of button "onAGP" of window "main") is 1 and (state of button "onPCI" of window "main") is 1 then
  110. set cardSupport to "IOAGPDevice, IOPCIDevice"
  111. end if
  112.  
  113. if (state of button "onAGP" of window "main") is 1 and (state of button "onPCI" of window "main") is 0 then
  114. set cardSupport to "IOAGPDevice"
  115. end if
  116.  
  117. if (state of button "onAGP" of window "main") is 0 and (state of button "onPCI" of window "main") is 1 then
  118. set cardSupport to "IOPCIDevice"
  119. end if
  120.  
  121. if (state of button "onAGP" of window "main") is 0 and (state of button "onPCI" of window "main") is 0 then
  122. set cardSupport to " "
  123. end if
  124.  
  125. set lineOne to "defaults write Configuration '{ GLCompositorConfiguration = { GLCompositorRequiredClasses = ( " & cardSupport & ") ; }; }'"
  126.  
  127. if (state of button "onPortable" of window "main") is 1 then
  128. set onOff to "true"
  129. end if
  130.  
  131. if (state of button "onPortable" of window "main") is 0 then
  132. set onOff to "false"
  133. end if
  134.  
  135. set lineTwo to "defaults write Configuration GLCompositorConfiguration -dict-add GLCompositorMinimumDisplayDepth -integer " & (contents of text field "minDepth" of window "main")
  136.  
  137. set lineThree to "defaults write Configuration GLCompositorConfiguration -dict-add GLCompositorMinimumVRAM -integer " & (contents of text field "minVRAM" of window "main")
  138.  
  139. set lineFour to "defaults write Configuration GLCompositorConfiguration -dict-add GLCompositorUseOnPortable -boolean " & onOff
  140.  
  141. set lineFive to "defaults write Configuration GLCompositorConfiguration -dict-add tileHeight -integer " & (contents of text field "tileHeight" of window "main")
  142.  
  143. set lineSix to "defaults write Configuration GLCompositorConfiguration -dict-add tileWidth -integer " & (contents of text field "tileWidth" of window "main")
  144.  
  145. do shell script lineOne
  146. do shell script lineTwo
  147. do shell script lineThree
  148. do shell script lineFour
  149. do shell script lineFive
  150. do shell script lineSix
  151.  
  152. do shell script "sudo cp $home/Library/Preferences/Configuration.plist /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/" with administrator privileges
  153.  
  154. tell application "Terminal"
  155. do script with command "sudo cp $home/Library/Preferences/Configuration.plist /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/"
  156. end tell
  157.  
  158. tell application "Finder"
  159. display dialog "Click Restart after Terminal stops" buttons ("Restart") default button 1
  160. restart
  161. end tell
  162.  
  163. quit
  164.  
  165. end if
  166. end if
  167. end clicked
  168. on action theObject
  169.     (*Add your script here.*)
  170. end action
  171.